package com.itheima01.day08;

import java.util.Scanner;

/**
 * @author 刘全
 * @date 2021/7/9
 */
/*
需求：键盘录入一个字符串，使用程序实现在控制台遍历该字符串
*/
public class String1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String s = sc.nextLine();
        char[] chars = s.toCharArray();              //for (int i = 0; i < s.length(); i++) {
        for (int i = 0; i < chars.length; i++) {  //System.out.println(a);
            System.out.println(chars[i]);
        }
    }
}
